package top.tenebrous.termbor.rpc.serialization;

import top.tenebrous.termbor.rpc.common.constants.RpcConstants;
import top.tenebrous.termbor.rpc.spi.SPI;

/**
 * @program: termbor-rpc
 * @description:
 * @author: yazhang6
 * @create: 2024-05-21 10:30
 **/
@SPI(RpcConstants.SERIALIZATION_JDK)
public interface Serialization {

    /**
     * 序列化
     */
    <T> byte[] serialize(T obj);

    /**
     * 反序列化
     */
    <T> T deserialize(byte[] data, Class<T> cls);

}
